/*
 * Criado em Mar 21, 2005
 *
 *
 */
package vendas.dto;

import gminet.infra.dao.SimpleTransferObject;

import java.util.List;

/**
 * @author Gabriel Flores Mendes
 * 
 * 
 */
public class SellerType extends SimpleTransferObject {

    private static final long serialVersionUID = 7893604006077371285L;

    private static final byte UNDEFINED_ID = 0;
    private static final byte EBAY_ID = 10;
    private static final byte WEB_SITE_ID = 20;
    private static final byte ML_ID = 30;
    private static final byte TRAVEL_ID = 40;
    private static final byte OTHER_ID = 90;

    public static final SellerType UNDEFINED = new SellerType(UNDEFINED_ID, "INDEFINIDO", false);
    public static final SellerType EBAY = new SellerType(EBAY_ID, "EBay", true);
    public static final SellerType WEB_SITE = new SellerType(WEB_SITE_ID, "Internet", false);
    public static final SellerType ML = new SellerType(ML_ID, "ML", true);
    public static final SellerType TRAVEL = new SellerType(TRAVEL_ID, "Viagem", false);
    public static final SellerType OTHER = new SellerType(OTHER_ID, "Outros", false);

    static {
        Class<SellerType> clazz = SellerType.class;
        addObject(clazz, EBAY);
        addObject(clazz, WEB_SITE);
        addObject(clazz, ML);
        addObject(clazz, OTHER);
    }

    private boolean webUser;

    private SellerType(int i, String str, boolean hasWebUserName) {

        super(i, str);
        setWebUser(hasWebUserName);
    }

    @SuppressWarnings("unchecked")
    public static List<SellerType> getList() {

        return (List<SellerType>) getList(SellerType.class);
    }

    public static SellerType getSellerTypeById(int id) {

        return (SellerType) getObject(SellerType.class, id);
    }

    public boolean isWebUser() {
        return webUser;
    }

    public void setWebUser(boolean webUserName) {
        this.webUser = webUserName;
    }

}
